<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<div id="CriteriaQuery">
    <form id="top_search_select" >
        <a>航班号:</a>   <input name="title" lay-verify="title" autocomplete="off" class="layui-input" value="航班号"  type="text" id="select_flightno" onblur="javascript:if(this.value=='')this.value='航班号';" onfocus="javascript:if(this.value=='航班号')this.value='';">
        <a>出发地:</a>      <input value="出发地"  type="text"  id="select_deptcity" onblur="javascript:if(this.value=='')this.value='出发地';" onfocus="javascript:if(this.value=='出发地')this.value='';" >
        <a>目的地:</a>      <input value="目的地" type="text"  id="select_arrcity"   onblur="javascript:if(this.value=='')this.value='目的地';" onfocus="javascript:if(this.value=='目的地')this.value='';" >
        <a>用户ID:</a>      <input value="用户ID"   type="text" id="select_userid"    onblur="javascript:if(this.value=='')this.value='用户ID';" onfocus="javascript:if(this.value=='用户ID')this.value='';"  >
        <a>联系人:</a>      <input value="联系人"  type="text"  id="select_linkman"  onblur="javascript:if(this.value=='')this.value='联系人';" onfocus="javascript:if(this.value=='联系人')this.value='';" >
        <a>联系人手机号:</a><input style="width: 100px"  value="联系人手机号"   type="text"id="select_linkphone" onblur="javascript:if(this.value=='')this.value='联系人手机号';"  onfocus="javascript:if(this.value=='联系人手机号')this.value='';" >
        <a>航班日期:</a>    <input value="航班日期"  type="text" id="select_flightdate" onblur="javascript:if(this.value=='')this.value='航班日期';" onfocus="javascript:if(this.value=='航班日期')this.value='';">
    </form>
</div>


<script>
    function condition_query() {
        var select_flightno   =document.getElementById("select_flightno").value;
        var select_deptcity   =document.getElementById("select_deptcity").value;
        var select_arrcity    =document.getElementById("select_arrcity").value;
        var select_userid     =document.getElementById("select_userid").value;
        var select_linkman    =document.getElementById("select_linkman").value;
        var select_linkphone  =document.getElementById("select_linkphone").value;
        var select_flightdate =document.getElementById("select_flightdate").value;
       $.ajax({
           url:"/order/condition_query",
           type:"post",
           dataType:"json",
           data:{
               'select_flightno':select_flightno  ,
               'select_deptcity':select_deptcity  ,
               'select_arrcity':select_arrcity   ,
               'select_userid':select_userid    ,
               'select_linkman':select_linkman   ,
               'select_linkphone':select_linkphone ,
               'select_flightdate':select_flightdate
           },
           success:function(data,state){
               var str ="<table id='showTable' class=\"table table-hover\" border=\"1\"  cellspacing=\"0\" align=\"center\" text-align:center>";
               str+="<tr>" +
                   "<td>选项</td>" +
                   "<td>订单号</td>" +
                   "<td>航班编号</td>" +
                   "<td>出发地</td>" +
                   "<td>目的地</td>" +
                   "<td>支付状态</td>" +
                   "<td>出票状态</td>" +
                   "<td>用户ID</td>" +
                   "<td>联系人</td>" +
                   "<td>联系人手机号</td>" +
                   "<td>航班日期</td>" +
                   "<td>仓位</td>" +
                   "<td>订单价格</td>" +
                   "<td>创建时间</td>" +
                   "<td colspan='2'>编辑</td></tr>";
               $.each(data,function(i,item){
                   if (item.tktstatus==0){
                       var tktstatus="未出票";
                   }else if(item.tktstatus==1){
                       var tktstatus ="已出票";
                   }
                   str+="<tr>";
                   str+="<td>"+"<input  id='ordercheck' type='checkbox' value='"+item.id+"'/>" +"</td>";
                   str+="<td>"+item.id+"</td>";
                   str+="<td>"+item.flightno+"</td>";
                   str+="<td>"+item.deptcity+"</td>";
                   str+="<td>"+item.arrcity+"</td>";
                   str+="<td>"+item.paystatus+"</td>";
                   str+="<td>"+item.tktstatus+"</td>";
                   str+="<td>"+item.userid+"</td>";
                   str+="<td>"+item.linkman+"</td>";
                   str+="<td>"+item.linkphone+"</td>";;
                   var flightdate=date_reversal(item.flightdate);
                   str+="<td>"+flightdate+"</td>";
                   str+="<td>"+item.flightcabin+"</td>";;
                   str+="<td>"+item.price+"</td>";
                   var creatdate=date_reversal(item.createtime);
                   str+="<td>"+creatdate+"</td>";
                   str+="<td>"+"<input onclick='change()' name='tktstatus' type=\"button\" id='"+item.id+"' class=\"btn btn-primary\"value=\""+tktstatus+"\"/>" +"</td>";
                   str+="<td>"+"<input onclick='queryOrderAll()' type=\"button\" id='"+'Ao'+item.id+"'class=\"btn btn-primary\" data-toggle=\"modal\" data-target=\"#exampleModal\" data-whatever=\"@mdo\"value='订单详情'/>" +"</td>";

                   str+="</tr>";

                   $("#list").html(str);
               });
               str+="</table>"

           }


       })

    }


</script>